<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org">
<head>
    <th:block th:include="include :: header('新增购物车')"/>
    <th:block th:include="include :: datetimepicker-css"/>
</head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
    <form class="form-horizontal m" id="form-shoppingCart-add">
        <div class="col-xs-12">
            <div class="form-group">
                <label class="col-sm-3 control-label">微信用户id：</label>
                <div class="col-sm-8">
                    <input name="wxUserId" class="form-control" type="text">
                </div>
            </div>
        </div>
        <div class="col-xs-12">
            <div class="form-group">
                <label class="col-sm-3 control-label">产品id：</label>
                <div class="col-sm-8">
                    <input name="productId" class="form-control" type="text">
                </div>
            </div>
        </div>
        <div class="col-xs-12">
            <div class="form-group">
                <label class="col-sm-3 control-label">规格id：</label>
                <div class="col-sm-8">
                    <input name="specificationId" class="form-control" type="text">
                </div>
            </div>
        </div>
        <div class="col-xs-12">
            <div class="form-group">
                <label class="col-sm-3 control-label">数量：</label>
                <div class="col-sm-8">
                    <input name="quantity" class="form-control" type="text">
                </div>
            </div>
        </div>
        <div class="col-xs-12">
            <div class="form-group">
                <label class="col-sm-3 control-label">添加时间：</label>
                <div class="col-sm-8">
                    <div class="input-group date">
                        <input name="addTime" class="form-control" placeholder="yyyy-MM-dd" type="text">
                        <span class="input-group-addon"><i class="fa fa-calendar"></i></span>
                    </div>
                </div>
            </div>
        </div>
        <div class="col-xs-12">
            <div class="form-group">
                <label class="col-sm-3 control-label">删除标记：</label>
                <div class="col-sm-8">
                    <div class="radio-box" th:each="dict : ${@dict.getType('applet_del_flag')}">
                        <input type="radio" th:id="${'delFlag_' + dict.dictCode}" name="delFlag" th:value="${dict.dictValue}" th:checked="${dict.default}">
                        <label th:for="${'delFlag_' + dict.dictCode}" th:text="${dict.dictLabel}"></label>
                    </div>
                </div>
            </div>
        </div>
    </form>
</div>
<th:block th:include="include :: footer"/>
<th:block th:include="include :: datetimepicker-js"/>
<script th:inline="javascript">

    let prefix = ctx + "applet/shoppingCart"

    $("#form-shoppingCart-add").validate({
        focusCleanup: true
    });

    function submitHandler() {
        if ($.validate.form()) {
            $.operate.save(prefix + "/add", $('#form-shoppingCart-add').serialize());
        }
    }

    $("input[name='addTime']").datetimepicker({
        format: "yyyy-mm-dd",
        minView: "month",
        autoclose: true
    });
</script>
</body>
</html>